/*
 * @Descripttion: 核酸宝项目前端
 * @version: 
 * @Author: 杜宇轩
 * @Date: 2022-05-22 05:23:33
 * @LastEditors: 杜宇轩
 * @LastEditTime: 2022-05-22 06:23:51
 */
import Vue from 'vue';
const prefix = '/natms/user/';

/**
 * 管理员查看用户数据
 * request: {}
 */
 export const adminCheckUser = () => {
  return Vue.$http({
    url: prefix + 'AllInfo',
    method: 'get'
  });
};

/**
 * 管理员删除某个用户账户
 * request: {
 *  userId: "" // 用户id
 * }
 */
 export const adminDeleteUser = (data) => {
  return Vue.$http({
    url: prefix + 'delete',
    method: 'post',
    data: {
      userId: data.userId
    }
  });
};

/**
 * 管理员修改用户权限
 * request: {
 *  userId: "", // 用户id
 *  newType: "" // 新权限
 * }
 */
export const adminUpdateUser = (data) => {
  return Vue.$http({
    url: prefix + 'updateType',
    method: 'post',
    data: {
      userId: data.userId,
      newType: data.newType
    }
  });
};

/**
 * 管理员查看用户检测结果
 * request: {
 *  userId: "" // 用户id
 * }
 */
 export const adminCheckNATR = (data) => {
  return Vue.$http({
    url: '/natms/reagent/ManagerGetResult',
    method: 'post',
    data: {
      userId: data.userId
    }
  });
};
